package com.baizhi.service.impl;

import com.baizhi.dao.AuctionRecordDao;
import com.baizhi.entity.AuctionRecord;
import com.baizhi.service.AuctionRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class AuctionRecordServiceImpl implements AuctionRecordService {
    private AuctionRecordDao auctionRecordDao;
    @Autowired
    public void setAuctionRecordDao(AuctionRecordDao auctionRecordDao) {
        this.auctionRecordDao = auctionRecordDao;
    }

    @Override
    public int insertRecord(AuctionRecord auctionRecord) {
        int i = auctionRecordDao.insertRecord(auctionRecord);
        return i;
    }

    @Override
    public List<AuctionRecord> selectByAuctionId(Integer auctionId) {
        List<AuctionRecord> auctionRecords = auctionRecordDao.selectByAuctionId(auctionId);
        return auctionRecords;
    }

    @Override
    public Double selectMaxAuctionRecordPrice(Integer auctionId) {
        Double price = auctionRecordDao.selectMaxAuctionRecordPrice(auctionId);
        return price;
    }
}
